/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dosindchuc.UI.swing;


import dosindchuc.UI.controller.DIVActionListener;
import dosindchuc.UI.swing.Help.DIVButtons;
import dosindchuc.model.entities.Help.SetEnums;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JTextField;

/**
 *
 * @author ir
 */
public class DIVFrm extends javax.swing.JFrame {

    DIVActionListener listeners;
    DIVButtons setButtonsState;
    
    /**
     * Creates new form ManagementFrm
     */
    public DIVFrm() {
        
        initComponents();
   
        listeners = new DIVActionListener(this);
        setButtonsState = new DIVButtons(this);
        
        initState ();
       
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        panelDosimetry = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        cbDIV_Category = new javax.swing.JComboBox();
        jLabel21 = new javax.swing.JLabel();
        cbDIV_Department = new javax.swing.JComboBox();
        btDIV_Search = new javax.swing.JButton();
        btDIV_Clean = new javax.swing.JButton();
        jLabel22 = new javax.swing.JLabel();
        txtDIV_dsmtID = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        txtDIV_Name = new javax.swing.JTextField();
        btDIV_Save = new javax.swing.JButton();
        btDIV_Cancel = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        panelTableNewDIVinfo = new javax.swing.JScrollPane();
        panelTableOldDIVInfo = new javax.swing.JScrollPane();
        panelTableDIVNotes = new javax.swing.JScrollPane();
        txtWorkerNameDIV = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel1.setFocusable(false);
        jPanel1.setRequestFocusEnabled(false);
        jPanel1.setVerifyInputWhenFocusTarget(false);

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/couple48.png"))); // NOI18N
        jButton2.setBorderPainted(false);
        jButton2.setContentAreaFilled(false);
        jButton2.setDefaultCapable(false);
        jButton2.setFocusPainted(false);
        jButton2.setFocusable(false);
        jButton2.setRequestFocusEnabled(false);
        jButton2.setRolloverEnabled(false);
        jButton2.setVerifyInputWhenFocusTarget(false);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logotipo_chuc_novo_48.png"))); // NOI18N
        jButton1.setBorderPainted(false);
        jButton1.setContentAreaFilled(false);
        jButton1.setDefaultCapable(false);
        jButton1.setFocusPainted(false);
        jButton1.setFocusable(false);
        jButton1.setRequestFocusEnabled(false);
        jButton1.setRolloverEnabled(false);
        jButton1.setVerifyInputWhenFocusTarget(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addComponent(jButton2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addGap(31, 31, 31))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton2)
                    .addComponent(jButton1))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jLabel20.setText("Department:");

        cbDIV_Category.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N
        cbDIV_Category.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Médico", "Físico", "Técnico", "Secretário", "Enfermeiro", "Auxiliar", "NoDef" }));
        cbDIV_Category.setSelectedIndex(6);
        cbDIV_Category.setToolTipText("");
        cbDIV_Category.setActionCommand("cbDIV_Category");

        jLabel21.setText("Category:");

        cbDIV_Department.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N
        cbDIV_Department.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "RT", "Img", "Orto", "BOC", "MN", "NoDef" }));
        cbDIV_Department.setSelectedIndex(5);
        cbDIV_Department.setActionCommand("cbDIV_Department");

        btDIV_Search.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/search48.png"))); // NOI18N
        btDIV_Search.setActionCommand("btDIV_Search");
        btDIV_Search.setBorderPainted(false);
        btDIV_Search.setContentAreaFilled(false);
        btDIV_Search.setFocusPainted(false);

        btDIV_Clean.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/clear48.png"))); // NOI18N
        btDIV_Clean.setActionCommand("btDIV_Clean");
        btDIV_Clean.setBorderPainted(false);
        btDIV_Clean.setContentAreaFilled(false);

        jLabel22.setText("Dsmt_ID:");

        txtDIV_dsmtID.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N

        jLabel23.setText("Name:");

        txtDIV_Name.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N

        btDIV_Save.setText("Save");
        btDIV_Save.setActionCommand("btDIV_Save");

        btDIV_Cancel.setText("Cancel");
        btDIV_Cancel.setActionCommand("btDIV_Cancel");

        jLabel1.setText("Notes:");

        txtWorkerNameDIV.setEditable(false);
        txtWorkerNameDIV.setBackground(new java.awt.Color(238, 238, 238));
        txtWorkerNameDIV.setFont(new java.awt.Font("Dialog", 3, 10)); // NOI18N
        txtWorkerNameDIV.setForeground(new java.awt.Color(153, 204, 255));
        txtWorkerNameDIV.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        txtWorkerNameDIV.setBorder(null);
        txtWorkerNameDIV.setFocusable(false);
        txtWorkerNameDIV.setOpaque(false);
        txtWorkerNameDIV.setRequestFocusEnabled(false);

        javax.swing.GroupLayout panelDosimetryLayout = new javax.swing.GroupLayout(panelDosimetry);
        panelDosimetry.setLayout(panelDosimetryLayout);
        panelDosimetryLayout.setHorizontalGroup(
            panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelDosimetryLayout.createSequentialGroup()
                .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(panelDosimetryLayout.createSequentialGroup()
                            .addGap(26, 26, 26)
                            .addComponent(jLabel20)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(cbDIV_Department, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(40, 40, 40)
                            .addComponent(jLabel22)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(txtDIV_dsmtID, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(34, 34, 34)
                            .addComponent(jLabel23)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(txtDIV_Name, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(42, 42, 42)
                            .addComponent(jLabel21)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(cbDIV_Category, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(panelDosimetryLayout.createSequentialGroup()
                            .addGap(257, 257, 257)
                            .addComponent(btDIV_Save)
                            .addGap(276, 276, 276)
                            .addComponent(btDIV_Cancel)))
                    .addGroup(panelDosimetryLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(panelTableNewDIVinfo, javax.swing.GroupLayout.PREFERRED_SIZE, 940, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(panelDosimetryLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(btDIV_Search)
                        .addGap(91, 91, 91)
                        .addComponent(btDIV_Clean)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtWorkerNameDIV, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE))
                    .addComponent(jLabel1)
                    .addComponent(panelTableOldDIVInfo)
                    .addComponent(panelTableDIVNotes))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelDosimetryLayout.setVerticalGroup(
            panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelDosimetryLayout.createSequentialGroup()
                .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelDosimetryLayout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(cbDIV_Category, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel21))
                            .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel20)
                                .addComponent(cbDIV_Department, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel22)
                                .addComponent(txtDIV_dsmtID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel23)
                                .addComponent(txtDIV_Name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelDosimetryLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btDIV_Search, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btDIV_Clean, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtWorkerNameDIV, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelDosimetryLayout.createSequentialGroup()
                        .addComponent(panelTableNewDIVinfo)
                        .addGap(18, 18, 18)
                        .addGroup(panelDosimetryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btDIV_Save)
                            .addComponent(btDIV_Cancel))
                        .addGap(23, 23, 23))
                    .addGroup(panelDosimetryLayout.createSequentialGroup()
                        .addComponent(panelTableOldDIVInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(31, 31, 31)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(panelTableDIVNotes, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(24, Short.MAX_VALUE))))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(panelDosimetry, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(3, 3, 3))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(panelDosimetry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        // TODO add your handling code here:
        MainFrm.btInsertIndDosimetry.setEnabled(true);
        
    }//GEN-LAST:event_formWindowClosing
   /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("1Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(DIVFrm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

       
        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new ManagementFrm().setVisible(true);
//            }
//        });
    }
    
    
    
       
//     DIVTable
    
    
    private void initState () {
        setButtonsState.setAllDIVBtsInit(true);
        
        this.cbDIV_Category.setModel(new DefaultComboBoxModel(SetEnums.worker_category.values()));
        this.cbDIV_Category.setSelectedIndex(SetEnums.worker_category.values().length - 1);
        this.cbDIV_Department.setModel(new DefaultComboBoxModel(SetEnums.worker_department.values()));
        this.cbDIV_Department.setSelectedIndex(SetEnums.worker_department.values().length - 1);
        
        
    } 

    public JButton getBtDIV_Clean() {
        return btDIV_Clean;
    }

    public void setBtDIV_Clean(JButton btDIV_Clean) {
        this.btDIV_Clean = btDIV_Clean;
    }


    public JComboBox getCbDIV_Category() {
        return cbDIV_Category;
    }

    public void setCbDIV_Category(JComboBox cbDIV_Category) {
        this.cbDIV_Category = cbDIV_Category;
    }

    public JComboBox getCbDIV_Department() {
        return cbDIV_Department;
    }

    public void setCbDIV_Department(JComboBox cbDIV_Department) {
        this.cbDIV_Department = cbDIV_Department;
    }

    public JTextField getTxtDIV_ID() {
        return txtDIV_dsmtID;
    }

    public void setTxtDIV_ID(JTextField txtDIV_ID) {
        this.txtDIV_dsmtID = txtDIV_ID;
    }

    public JTextField getTxtDIV_Name() {
        return txtDIV_Name;
    }

    public void setTxtDIV_Name(JTextField txtDIV_Name) {
        this.txtDIV_Name = txtDIV_Name;
    }

    public JButton getBtDIVCancel() {
        return btDIV_Cancel;
    }

    public void setBtDIVCancel(JButton btDIVCancel) {
        this.btDIV_Cancel = btDIVCancel;
    }

    public JButton getBtDIV_Save() {
        return btDIV_Save;
    }

    public void setBtDIV_Save(JButton btDIV_Save) {
        this.btDIV_Save = btDIV_Save;
    }
    
    
    // para IdDSmt
    public JComboBox comboDsmtID = new JComboBox();

    public JComboBox getComboDsmtID() {
        return comboDsmtID;
    }

    public void setComboDsmtID(JComboBox comboDsmtID) {
        this.comboDsmtID = comboDsmtID;
    }
  
    // para Periodicity  - Mensal
    public JComboBox comboPerdMonth = new JComboBox(SetEnums.month.values());

    public JComboBox getComboPerdMonth() {
        return comboPerdMonth;
    }

    public void setPerdMonth(JComboBox comboPerdMonth) {
        this.comboPerdMonth = comboPerdMonth;
    }
   
    // para Perioodicity - Trimestral
    public JComboBox comboPerdTrimester = new JComboBox(SetEnums.Trimester.values());

    public JComboBox getComboPerdTrimester() {
        return comboPerdTrimester;
    }

    public void setComboPerdTrimester(JComboBox comboPerdTrimester) {
        this.comboPerdTrimester = comboPerdTrimester;
    }

    public JTextField getTxtWorkerNameDIV() {
        return txtWorkerNameDIV;
    }

    public void setTxtWorkerNameDIV(JTextField txtWorkerNameDIV) {
        this.txtWorkerNameDIV = txtWorkerNameDIV;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton btDIV_Cancel;
    public javax.swing.JButton btDIV_Clean;
    public javax.swing.JButton btDIV_Save;
    public javax.swing.JButton btDIV_Search;
    public javax.swing.JComboBox cbDIV_Category;
    public javax.swing.JComboBox cbDIV_Department;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel panelDosimetry;
    public javax.swing.JScrollPane panelTableDIVNotes;
    public javax.swing.JScrollPane panelTableNewDIVinfo;
    public javax.swing.JScrollPane panelTableOldDIVInfo;
    public javax.swing.JTextField txtDIV_Name;
    public javax.swing.JTextField txtDIV_dsmtID;
    public javax.swing.JTextField txtWorkerNameDIV;
    // End of variables declaration//GEN-END:variables
}
